# -*- coding:UTF-8 -*-#

'''
@author: qianwp
'''
from popcan.redis.redisbase import BaseRedisDao
from popcan.model.models import AlbumDesc
from popcan.core.structures import Singleton
from popcan.helper.loggerhelper import Module,QueueLogger
from popcan.redis.redisbase import RedisLinker
from popcan.globals.settings import RedisSettings
from popcan.core.halt import HaltManager,RedisHaltHooker
from redis import Redis

class RedisDaoLoader(Singleton):
    
    def loadRedisDaos(self):
        QueueLogger().info(Module.Load, 'loading redis daos')
        redisclient = Redis(host=RedisSettings.host,port=RedisSettings.port,db=RedisSettings.db)
        linker = RedisLinker(redisclient)
        HaltManager().addHooker(RedisHaltHooker(linker))
        AlbumDescRedisDao(linker)
        QueueLogger().info(Module.Load, 'redis daos loaded success')

class AlbumDescRedisDao(BaseRedisDao):
    
    def __init__(self,linker):
        super(AlbumDescRedisDao,self).__init__(linker,AlbumDesc)
        
    